package controller

import (
	"github.com/gin-gonic/gin"
	"my_gin_open/model/captcha"
	"my_go_open/utils"
)

func Captcha(c *gin.Context) {
	name := c.Query("n")
	if len(name) == 0 {
		name = "captcha4"
	}
	captcha.WriteWithOptions(c, "captcha_"+utils.StrMd5(name), 150, 50, 4)
}

func Captcha6(c *gin.Context) {
	name := c.Query("n")
	if len(name) == 0 {
		name = "captcha6"
	}
	captcha.WriteWithOptions(c, "captcha_"+utils.StrMd5(name), 210, 50, 6)
}
